package com.zhongyu.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongyu.pojo.Cangku;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CangkuMapper extends BaseMapper<Cangku> {
    @Select("select t1.*,t2.id ,t2.* from smbms_cangku t1\n" +
            "left  join smbms_user t2\n" +
            " on t1.user_id=t2.id  ${ew.customSqlSegment}")
    @ResultMap("cangkuRm")
    List<Cangku> findAll(Page page , @Param("ew") Wrapper wrapper);

    @Select("select * from smbms_cangku where user_id=#{userId}")
    @ResultMap("cangkuRm")
    List<Cangku> findByuserId(Integer userId);

}
